const initalState = {
  count:100
};

export function counterReducer(state=initalState,action){
  // console.log(action);
  switch (action.type){
    case "plus":
      state.count++
      return {
        count:state.count
      };
    case "minus":
      state.count===0?state.count=0:state.count--
      return {
        count:state.count
      };
    default:
      return state;
  }
}